package com.meilele.dao.guoziyang;

import com.meilele.entity.guoziyang.Seclaber;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface SeclaberMapper {
    @Delete({
        "delete from sec_laber",
        "where style_id = #{styleId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer styleId);

    @Insert({
        "insert into sec_laber (style_id, style_laber, ",
        "style_big_type)",
        "values (#{styleId,jdbcType=INTEGER}, #{styleLaber,jdbcType=VARCHAR}, ",
        "#{styleBigType,jdbcType=INTEGER})"
    })
    int insert(Seclaber record);

    int insertSelective(Seclaber record);

    @Select({
        "select",
        "style_id, style_laber, style_big_type",
        "from sec_laber",
        "where style_id = #{styleId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.guoziyang.SeclaberMapper.BaseResultMap")
    Seclaber selectByPrimaryKey(Integer styleId);

    int updateByPrimaryKeySelective(Seclaber record);

    @Update({
        "update sec_laber",
        "set style_laber = #{styleLaber,jdbcType=VARCHAR},",
          "style_big_type = #{styleBigType,jdbcType=INTEGER}",
        "where style_id = #{styleId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Seclaber record);
    @Select({
            "select",
            "style_id, style_laber, style_big_type",
            "from sec_laber"
    })
    @ResultMap("com.meilele.dao.guoziyang.SeclaberMapper.BaseResultMap")
    List<Seclaber> selectAlly();

    @Results(value = {
            @Result(column = "style_id" , property = "styleId"),
            @Result(column = "style_laber" , property = "styleLaber")
    })
@Select({"SELECT style_id , style_laber FROM sec_laber la WHERE la.style_big_type = #{id}"})
    List<Seclaber> findByid(int id);


}